<template>
	<view class="outside" @click="handlerClick">
		<view class="showing" v-if="showing">正在展出</view>
		<view class="content">
			<image :src="img" mode="widthFix"></image>
			<view class="text">{{title}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			id: String,
			showing: Boolean,
			img: String,
			title: String
		},
		methods: {
			handlerClick() {
				this.$emit("goTo", 'showInfo', this.id)
			}
		}
	}
</script>

<style>
	.outside {
		padding: 10rpx;
		width: 100%;
		height: 100%;
		position: relative;
	}

	.showing {
		z-index: 10;
		position: absolute;
		top: 10rpx;
		right: 0;
		height: 42rpx;
		width: 120rpx;
		line-height: 42rpx;
		color: #fff;
		text-align: center;
		background: #AE6059;
		font-size: 18rpx;
		border-radius: 0 5rpx 0 15rpx;
	}

	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		height: calc(100% - 30rpx);
		width: 100%;
		margin: 0 10rpx;
	}

	.content image {
		border-radius: 5rpx;
		height: 100%;
		width: 100%;
	}

	.text {
		text-align: left;
		width: 100%;
		color: #333;
		font-size: 28rpx;
		margin: 20rpx 0;
		text-overflow: ellipsis;
		white-space: nowrap;
		overflow: hidden;
	}
</style>
